import { getAction, deleteAction, postAction ,putAction} from '@/api/manage'
const operate = '/jic-backend-operation/operate/collocation/'
const baseURL  = window._CONFIG['domianURL']  || '/jeecg-boot'
export const getStyle = params => getAction(operate + 'getLabel', params)
export const gateway = '/api/gateway'
// look标签
export const lookLabel= params => postAction(operate + 'lookLabel',params)
// look搭配类型
export const lookType= () => postAction(operate + 'collocationType')
//单品搭配
export const importUrl = '/api/gateway' + operate + 'import'
export const importJudge = operate + 'importJudge'
export const getLable = params => getAction(operate + 'getLabel', params)
export const list = params => postAction(operate + 'page', params)
export const updateCollcation = params => postAction(operate + 'update', params)
export const getDetails = id => postAction(`${operate}getDetails?id=${id}`)
export const createCollocation = params => postAction(operate + 'add', params)
export const updateCollocationStatus = params => postAction(`${operate}status?id=${params.id}&status=${params.status}`)
export const removeCollocation = id => postAction(`${operate}delete?id=${id}`)
export const verification = params => deleteAction(operate + 'getModelSingle', params)
export const removeGoods = id => postAction(`${operate}modelDelete?id=${id}`)
export const addGoods = params => postAction(`${operate}getProductAttrDetails?productNoSkc=${params.productNoSkc}&mainId=${params.mainId}`)
export const handleNum = params => postAction(`${operate}perfectNum`)
export const downLoadOfficeTmplate = `${baseURL+gateway+operate}exportCollocation`
export const iprotantState = () => getAction(`${operate}importState`)
export const downloadResults = `${baseURL+gateway+operate}downloadResults`
export const gettest = () => getAction(downLoadOfficeTmplate)

// 更多搭配
const more = operate + 'more/'
export const importMoreUrl = '/api/gateway' + more + 'import'
export const importMoreJudge = more + 'importJudge'
export const updateMoreCollcation = params => postAction(more + 'update', params)
export const getMoreDetails = params => postAction(`${more}getDetails`,params)
export const createMoreCollocation = params => postAction(more + 'add', params)
export const listMore = params => postAction(more + 'page', params)
export const updateMoreCollocationStatus = params => postAction(`${more}status?id=${params.id}&status=${params.status}`)
export const removeMoreCollocation = id => postAction(`${more}delete?id=${id}`)
export const removeMoreGoods = id => postAction(`${more}mallDelete?id=${id}`)
export const addMoreGoods = params => postAction(`${more}addDetails?productNoSkc=${params.productNoSkc}&id=${params.id}`)
export const moreHandleNum = params => postAction(`${operate}more/perfectNum`)
export const batchUpdateOfficial = params => postAction(`${operate}batchStatus`,params)
export const batchDeleteOfficial = params => postAction(`${operate}batchDelete`,params)
export const batchUpdateMore = params => postAction(`${more}batchStatus`,params)
export const batchDeleteMore = params => postAction(`${more}batchDelete`,params)


const lookUrl = '/jic-backend-operation/operate/collocation/look'

export const downLoadMoreTmplate = `${baseURL + gateway + operate}more/exportCollocation`
export const lookList = params => getAction(lookUrl,params)